\hypertarget{class_service}{\section{Service Class Reference}
\label{class_service}\index{Service@{Service}}
}


{\ttfamily \#include $<$Service.\-hpp$>$}

Inheritance diagram for Service\-:\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[height=7.293777cm]{class_service}
\end{center}
\end{figure}
\subsection*{Public Member Functions}
\begin{DoxyCompactItemize}
\item 
\hyperlink{class_service_acc246c9f7ed3c51e2d91d10fe257513f}{Service} ()
\item 
virtual \hyperlink{class_service_af6c3577b59652ac817d1d76aaccee904}{$\sim$\-Service} ()
\item 
bool \hyperlink{class_service_ac6ba2b89e56e24074c03c61254ab7f14}{Get\-Is\-Started} () const 
\item 
void \hyperlink{class_service_ab90e8000ec50c6c618226d27a562b151}{Start} ()
\item 
void \hyperlink{class_service_a5e52f5900502d844e424861b20fcd66b}{Stop} ()
\end{DoxyCompactItemize}
\subsection*{Protected Member Functions}
\begin{DoxyCompactItemize}
\item 
\hyperlink{class_service}{Service} \& \hyperlink{class_service_a39d6da19d7f51c1df904f482101557c2}{Add\-Subservice} (\hyperlink{class_service}{Service} \&service)
\item 
virtual void \hyperlink{class_service_a37c9e32f9044122d3a6d2ab40fc17c39}{Handle\-Start} ()
\item 
virtual void \hyperlink{class_service_a38a2e9e764f74fe0da634d2252ee8744}{Handle\-Stop} ()
\item 
virtual void \hyperlink{class_service_a9604d04295202019e9a15f8c93bb31c6}{Handle\-Periodic} ()
\end{DoxyCompactItemize}
\subsection*{Friends}
\begin{DoxyCompactItemize}
\item 
\hypertarget{class_service_af45e8a01b72511d7dc39a93fdbeada29}{class {\bfseries Systematic\-Robot}}\label{class_service_af45e8a01b72511d7dc39a93fdbeada29}

\item 
\hypertarget{class_service_a184f0b5ddaaf495f876254d012d30fb0}{class {\bfseries Compound\-Service}}\label{class_service_a184f0b5ddaaf495f876254d012d30fb0}

\item 
\hypertarget{class_service_ad8c7806d4e98a1747e10c6ee871410b9}{class {\bfseries State\-Machine\-Service}}\label{class_service_ad8c7806d4e98a1747e10c6ee871410b9}

\end{DoxyCompactItemize}


\subsection{Detailed Description}
The \hyperlink{class_service}{Service} class controls robot subsystems and other Services.

A \hyperlink{class_service}{Service} broadly represents a will to do something. (e.\-g. A Drive\-Service would represent the will to drive the robot.)

To use it, create subclasses that override Handle\-Start, Handle\-Stop, and Handle\-Periodic. Remember that they will only run if they have been started by the Start function.

All Services must be added to the \hyperlink{class_systematic_robot}{Systematic\-Robot} or to a \hyperlink{class_service}{Service} already added to the robot. A service can be added to the robot in such a way as to run when the robot is in a certain state (e.\-g. Autonomous, Teleop). They will be started at the correct time, and can start other Services as needed.

Testing shows this class works. 

\subsection{Constructor \& Destructor Documentation}
\hypertarget{class_service_acc246c9f7ed3c51e2d91d10fe257513f}{\index{Service@{Service}!Service@{Service}}
\index{Service@{Service}!Service@{Service}}
\subsubsection[{Service}]{\setlength{\rightskip}{0pt plus 5cm}Service\-::\-Service (
\begin{DoxyParamCaption}
{}
\end{DoxyParamCaption}
)}}\label{class_service_acc246c9f7ed3c51e2d91d10fe257513f}
Constructor for \hyperlink{class_service}{Service}. \hypertarget{class_service_af6c3577b59652ac817d1d76aaccee904}{\index{Service@{Service}!$\sim$\-Service@{$\sim$\-Service}}
\index{$\sim$\-Service@{$\sim$\-Service}!Service@{Service}}
\subsubsection[{$\sim$\-Service}]{\setlength{\rightskip}{0pt plus 5cm}Service\-::$\sim$\-Service (
\begin{DoxyParamCaption}
{}
\end{DoxyParamCaption}
)\hspace{0.3cm}{\ttfamily [virtual]}}}\label{class_service_af6c3577b59652ac817d1d76aaccee904}
Destructor for \hyperlink{class_service}{Service}. 

\subsection{Member Function Documentation}
\hypertarget{class_service_a39d6da19d7f51c1df904f482101557c2}{\index{Service@{Service}!Add\-Subservice@{Add\-Subservice}}
\index{Add\-Subservice@{Add\-Subservice}!Service@{Service}}
\subsubsection[{Add\-Subservice}]{\setlength{\rightskip}{0pt plus 5cm}{\bf Service} \& Service\-::\-Add\-Subservice (
\begin{DoxyParamCaption}
\item[{{\bf Service} \&}]{service}
\end{DoxyParamCaption}
)\hspace{0.3cm}{\ttfamily [protected]}}}\label{class_service_a39d6da19d7f51c1df904f482101557c2}
Add a subservice to the service.

This is necessary for two reasons.
\begin{DoxyEnumerate}
\item So subservice gets added to the robot automatically.
\item So this service and one subservice can share a control lock on the same object (such as a subsystem).
\end{DoxyEnumerate}


\begin{DoxyParams}{Parameters}
{\em serivice} & A reference to the \hyperlink{class_service}{Service} to be added as a subservice.\\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
The service parameter. 
\end{DoxyReturn}
\hypertarget{class_service_ac6ba2b89e56e24074c03c61254ab7f14}{\index{Service@{Service}!Get\-Is\-Started@{Get\-Is\-Started}}
\index{Get\-Is\-Started@{Get\-Is\-Started}!Service@{Service}}
\subsubsection[{Get\-Is\-Started}]{\setlength{\rightskip}{0pt plus 5cm}bool Service\-::\-Get\-Is\-Started (
\begin{DoxyParamCaption}
{}
\end{DoxyParamCaption}
) const}}\label{class_service_ac6ba2b89e56e24074c03c61254ab7f14}
Get whether the \hyperlink{class_service}{Service} is started.

\begin{DoxyReturn}{Returns}
Whether the \hyperlink{class_service}{Service} is started. 
\end{DoxyReturn}
\hypertarget{class_service_a9604d04295202019e9a15f8c93bb31c6}{\index{Service@{Service}!Handle\-Periodic@{Handle\-Periodic}}
\index{Handle\-Periodic@{Handle\-Periodic}!Service@{Service}}
\subsubsection[{Handle\-Periodic}]{\setlength{\rightskip}{0pt plus 5cm}void Service\-::\-Handle\-Periodic (
\begin{DoxyParamCaption}
{}
\end{DoxyParamCaption}
)\hspace{0.3cm}{\ttfamily [protected]}, {\ttfamily [virtual]}}}\label{class_service_a9604d04295202019e9a15f8c93bb31c6}
This function should be overridden to handle the periodic \hyperlink{class_service}{Service} tasks. It will be called periodically when the this controller is started. 

Reimplemented from \hyperlink{class_subscriber_a6ffeb82e812ef06db4aff08ee01d427b}{Subscriber}.



Reimplemented in \hyperlink{class_selector_service_a03e873370af26ecad1d1ac5a77d62c42}{Selector\-Service$<$ Item $>$}, \hyperlink{class_selector_service_a03e873370af26ecad1d1ac5a77d62c42}{Selector\-Service$<$ Service $\ast$ $>$}, \hyperlink{class_two_joystick_drive_service_aac337e302b872d3126366ceb966aec3c}{Two\-Joystick\-Drive\-Service$<$ Drive, Value, Handler $>$}, \hyperlink{class_two_joystick_drive_service_aac337e302b872d3126366ceb966aec3c}{Two\-Joystick\-Drive\-Service$<$ Mecanum\-Drive\-Subsystem, Cartesian\-Value, Mecanum\-Drive\-Subsystem\-::\-Drive\-By\-Cartesian $>$}, \hyperlink{class_two_joystick_drive_service_aac337e302b872d3126366ceb966aec3c}{Two\-Joystick\-Drive\-Service$<$ Tank\-Drive\-Subsystem, Tank\-Value, Tank\-Drive\-Subsystem\-::\-Drive\-By\-Tank $>$}, \hyperlink{class_joystick_drive_service_a14aafab1dedef204fbb3b4687e337732}{Joystick\-Drive\-Service$<$ Drive, Value, Handler $>$}, \hyperlink{class_joystick_drive_service_a14aafab1dedef204fbb3b4687e337732}{Joystick\-Drive\-Service$<$ Tank\-Drive\-Subsystem, Tank\-Value, Tank\-Drive\-Subsystem\-::\-Drive\-By\-Tank $>$}, \hyperlink{class_async_result_finish_state_a9c327aa447e197c8f6e3b50150d46162}{Async\-Result\-Finish\-State$<$ Result $>$}, \hyperlink{class_xbox_drive_service_a1eb41645f36bf2a5c20777b0659fab12}{Xbox\-Drive\-Service$<$ Drive, Value, Handler $>$}, \hyperlink{class_xbox_drive_service_a1eb41645f36bf2a5c20777b0659fab12}{Xbox\-Drive\-Service$<$ Mecanum\-Drive\-Subsystem, Cartesian\-Value, Mecanum\-Drive\-Subsystem\-::\-Drive\-By\-Cartesian $>$}, \hyperlink{class_ps3_drive_service_ab169aaf1d278843a0b7df0aea3396b9b}{Ps3\-Drive\-Service$<$ Drive, Value, Fetcher, Handler $>$}, \hyperlink{class_state_a29e67195da90c4c44e0e8f0fbe938c7c}{State}, \hyperlink{class_state_machine_service_a6d449ca476108879d39c457f6ed0c443}{State\-Machine\-Service}, \hyperlink{class_live_window_service_afbb5d49a99c6d033d4556f9e32917ad3}{Live\-Window\-Service}, \hyperlink{class_game_service_a8a71b44e940f9698128ca46b19ed7abb}{Game\-Service}, \hyperlink{class_async_status_finish_state_a21f727ef7e4c1e5f284febf8f649f19a}{Async\-Status\-Finish\-State}, and \hyperlink{class_time_wait_state_a67589e93acff3c395470f3fb4ad43e57}{Time\-Wait\-State}.

\hypertarget{class_service_a37c9e32f9044122d3a6d2ab40fc17c39}{\index{Service@{Service}!Handle\-Start@{Handle\-Start}}
\index{Handle\-Start@{Handle\-Start}!Service@{Service}}
\subsubsection[{Handle\-Start}]{\setlength{\rightskip}{0pt plus 5cm}void Service\-::\-Handle\-Start (
\begin{DoxyParamCaption}
{}
\end{DoxyParamCaption}
)\hspace{0.3cm}{\ttfamily [protected]}, {\ttfamily [virtual]}}}\label{class_service_a37c9e32f9044122d3a6d2ab40fc17c39}
This function should be overridden to handle the \hyperlink{class_service}{Service} starting. 

Reimplemented in \hyperlink{class_selector_service_a422be7e8347b12f51baa756797b6a855}{Selector\-Service$<$ Item $>$}, \hyperlink{class_selector_service_a422be7e8347b12f51baa756797b6a855}{Selector\-Service$<$ Service $\ast$ $>$}, \hyperlink{class_state_machine_service_a146fcaefa174e2ba1fc0a0b2c04ae64d}{State\-Machine\-Service}, \hyperlink{class_live_window_service_af6494d6c02f3e51792203f3ed60a43a0}{Live\-Window\-Service}, and \hyperlink{class_compound_service_ab0bb8d8f7b5bc8f9f5911d9c17637452}{Compound\-Service}.

\hypertarget{class_service_a38a2e9e764f74fe0da634d2252ee8744}{\index{Service@{Service}!Handle\-Stop@{Handle\-Stop}}
\index{Handle\-Stop@{Handle\-Stop}!Service@{Service}}
\subsubsection[{Handle\-Stop}]{\setlength{\rightskip}{0pt plus 5cm}void Service\-::\-Handle\-Stop (
\begin{DoxyParamCaption}
{}
\end{DoxyParamCaption}
)\hspace{0.3cm}{\ttfamily [protected]}, {\ttfamily [virtual]}}}\label{class_service_a38a2e9e764f74fe0da634d2252ee8744}
This function should be overridden to handle the \hyperlink{class_service}{Service} stopping. 

Reimplemented in \hyperlink{class_selector_service_a0105771fb348849983bfd2f622928626}{Selector\-Service$<$ Item $>$}, \hyperlink{class_selector_service_a0105771fb348849983bfd2f622928626}{Selector\-Service$<$ Service $\ast$ $>$}, \hyperlink{class_two_joystick_drive_service_a30d954d7a0e110e2333fd95d69631471}{Two\-Joystick\-Drive\-Service$<$ Drive, Value, Handler $>$}, \hyperlink{class_two_joystick_drive_service_a30d954d7a0e110e2333fd95d69631471}{Two\-Joystick\-Drive\-Service$<$ Mecanum\-Drive\-Subsystem, Cartesian\-Value, Mecanum\-Drive\-Subsystem\-::\-Drive\-By\-Cartesian $>$}, \hyperlink{class_two_joystick_drive_service_a30d954d7a0e110e2333fd95d69631471}{Two\-Joystick\-Drive\-Service$<$ Tank\-Drive\-Subsystem, Tank\-Value, Tank\-Drive\-Subsystem\-::\-Drive\-By\-Tank $>$}, \hyperlink{class_joystick_drive_service_a10fdd6658947a370286c07028cebce24}{Joystick\-Drive\-Service$<$ Drive, Value, Handler $>$}, \hyperlink{class_joystick_drive_service_a10fdd6658947a370286c07028cebce24}{Joystick\-Drive\-Service$<$ Tank\-Drive\-Subsystem, Tank\-Value, Tank\-Drive\-Subsystem\-::\-Drive\-By\-Tank $>$}, \hyperlink{class_xbox_drive_service_a4f77af860a0bcb98d07fc7a79c8e9104}{Xbox\-Drive\-Service$<$ Drive, Value, Handler $>$}, \hyperlink{class_xbox_drive_service_a4f77af860a0bcb98d07fc7a79c8e9104}{Xbox\-Drive\-Service$<$ Mecanum\-Drive\-Subsystem, Cartesian\-Value, Mecanum\-Drive\-Subsystem\-::\-Drive\-By\-Cartesian $>$}, \hyperlink{class_ps3_drive_service_a135315dcf41b30931c842519978e1fc2}{Ps3\-Drive\-Service$<$ Drive, Value, Fetcher, Handler $>$}, and \hyperlink{class_live_window_service_ae274bcb5c79ee4b856996760906164af}{Live\-Window\-Service}.

\hypertarget{class_service_ab90e8000ec50c6c618226d27a562b151}{\index{Service@{Service}!Start@{Start}}
\index{Start@{Start}!Service@{Service}}
\subsubsection[{Start}]{\setlength{\rightskip}{0pt plus 5cm}void Service\-::\-Start (
\begin{DoxyParamCaption}
{}
\end{DoxyParamCaption}
)}}\label{class_service_ab90e8000ec50c6c618226d27a562b151}
Starts the \hyperlink{class_service}{Service} and subscribes to the robot. \hypertarget{class_service_a5e52f5900502d844e424861b20fcd66b}{\index{Service@{Service}!Stop@{Stop}}
\index{Stop@{Stop}!Service@{Service}}
\subsubsection[{Stop}]{\setlength{\rightskip}{0pt plus 5cm}void Service\-::\-Stop (
\begin{DoxyParamCaption}
{}
\end{DoxyParamCaption}
)}}\label{class_service_a5e52f5900502d844e424861b20fcd66b}
Stops the \hyperlink{class_service}{Service} and unsubscribes from the robot. 

The documentation for this class was generated from the following files\-:\begin{DoxyCompactItemize}
\item 
C\-:/\-Users/\-Sam/\-Projects/\-F\-R\-C/\-Libraries/\-Fpk/\-Entech-\/\-Fpk-\/\-Subscribers/\-Entech-\/\-Fpk/\-Services/Service.\-hpp\item 
C\-:/\-Users/\-Sam/\-Projects/\-F\-R\-C/\-Libraries/\-Fpk/\-Entech-\/\-Fpk-\/\-Subscribers/\-Entech-\/\-Fpk/\-Services/Service.\-cpp\end{DoxyCompactItemize}
